test: cache fixture PDFs so CI does not depend on external servers - #106
Merged
Conversation
The test suite downloaded sample PDFs from the publisher servers (biogeosciences.net / copernicus.org) on every run via tests/download.py. Those servers are flaky and have started resetting connections and returning IncompleteRead, failing CI on unrelated (docs-only) commits. Commit the three stable fixture PDFs so _downloadpdf() finds them already present and skips the network entirely. The inner .gitignore still ignores any other stray downloaded PDFs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
CI has been failing on
tests/test_add.py::TestAdd::test_addon unrelated (docs-only) commits. The cause is not a code bug — the test suite'ssetUpdownloads sample PDFs from the publisher servers (biogeosciences.net→bg.copernicus.org) on every run viatests/download.py. Those servers have become unreliable:ConnectionResetError [Errno 104] Connection reset by peerhttp.client.IncompleteRead(across all 7 Python versions)Because pytest runs with
-x, this single networked fixture aborts the entire suite.Fix
Commit the three stable fixture PDFs so
_downloadpdf()finds them already present and skips the network entirely:tests/downloadedpapers/.gitignore(stray downloads stay ignored).bg-8-515-2011.pdf,esd-4-11-2013.pdf,esd-4-11-2013-supplement.pdf(~14 MB total).Verified locally with the network fully blocked: all three fixtures resolve from cache, no connection attempted.
Tradeoff
Adds ~14 MB of binaries to git history. The alternative (GitHub Actions cache) still hits the flaky server on a cache miss, so vendoring is the more robust fix.